import React from 'react';
import { AppstoreOutlined, MailOutlined, SettingOutlined } from '@ant-design/icons';
import type { MenuProps } from 'antd';
import { Menu, Spin } from 'antd';
import { ItemType } from 'antd/es/menu/interface';

interface IProps {
  /** 菜单 */
  menuItem: ItemType[];
  /** 当前选中分组 */
  selectedKeys: string[];
  /** 选中点击事件 */
  onClickMenuItem: MenuProps['onClick'];
}

const Sidebar: React.FC<IProps> = ({ menuItem, onClickMenuItem }) => {

  /** 获取菜单数据 */
  React.useEffect(() => {

  }, []);

  return (
    <Spin spinning={false}>
      <Menu
        onClick={onClickMenuItem}
        style={{ width: 256 }}
        defaultSelectedKeys={['VTEC']}
        defaultOpenKeys={['TEC']}
        mode="inline"
        items={menuItem}
      />
    </Spin>
  );
};

export default Sidebar;